def detectCapitalUse(word: str) -> bool:
    count1 = 0
    count2 = 0
    for i in range(len(word)):
        if word[i].isupper():
            count1+=1
        else:
            count2+=1
    if count1==0 or count2 ==0:
        return True
    if count1 == 1 and word[0].isupper():
        return True 
    return False